package com.wwtech.epp.ui.activity.work.module;

import com.wwtech.epp.data.api.HttpAPIWrapper;
import com.wwtech.epp.ui.activity.base.ActivityScope;
import com.wwtech.epp.ui.activity.work.TaskDetailActivity;
import com.wwtech.epp.ui.activity.work.contract.TaskDetailContract;
import com.wwtech.epp.ui.activity.work.presenter.TaskDetailPresenter;
import com.wwtech.epp.ui.adapter.work.LookAttachmentAdapter;

import java.util.ArrayList;

import dagger.Module;
import dagger.Provides;

/**
 * @author hzp
 * @Package com.wwtech.epp.ui.activity.work
 * @Description: The moduele of TaskDetailActivity, provide field for TaskDetailActivity
 * @date 2017/10/10 10:58:33
 */
@Module
public class TaskDetailModule {
    private final TaskDetailContract.View mView;


    public TaskDetailModule(TaskDetailContract.View view) {
        this.mView = view;
    }

    @Provides
    @ActivityScope
    public TaskDetailPresenter provideTaskDetailPresenter(HttpAPIWrapper httpAPIWrapper, TaskDetailActivity mActivity) {
        return new TaskDetailPresenter(httpAPIWrapper, mView, mActivity);
    }

    @Provides
    @ActivityScope
    public TaskDetailActivity provideTaskDetailActivity() {
        return (TaskDetailActivity) mView;
    }

    @Provides
    @ActivityScope
    public LookAttachmentAdapter provideLookAttachmentAdapter() {
        return new LookAttachmentAdapter(new ArrayList<>());
    }
}